import service from '@/utils/request'

export const useOrgListApi = (params) => {
	return service.get('/sys/org/list?' + params)
}

export const useOrgApi = (id: Number) => {
	return service.get('/sys/org/' + id)
}
export const getDelOrgCode = (dataForm: any) => {
	return service({
	  url: '/sys/org/getDelOrgByOrgCode',
	  method: 'get',
	  params: dataForm
	})
  }

export const useOrgSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/sys/org', dataForm)
	} else {
		return service.post('/sys/org', dataForm)
	}
}